<include file="public:header" />
<div class="pad-10">
	<if condition="$code eq 'taobao'">
    <div class="table-list">
    <form action="" method="post">
        <table width="100%" cellspacing="0">
            <thead>
            <tr>
            	<!--<th><input type="checkbox" class="check_all"/></th>-->
                <th>分类</th>
                <th>采集时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="items_cate_list.parent" id="val" >
            <tr>
                <!--<td style="width:30px;" align="center">
                    <input type="checkbox" id="cb_{$val.id}" class="cb" name="cate[]" value="{$val.id}"/>
                </td>-->
                <td align="left">&nbsp;&nbsp;<img src="__ROOT__/statics/admin/images/tv-expandable.gif" class="expandable" id="{$val.id}" />&nbsp;&nbsp;<b>{$val.name}</b></td>
                <td align="center"></td>
                <td align="center"></td>
            </tr>
            <volist name="items_cate_list['sub'][$val['id']]" id="sval" >
            <tr class="sub_{$val.id}" style="display:none;">
               <!-- <td align="center">
                    <input type="checkbox" id="subcb_{$sval.id}" class="cb_{$val.id} subcb" name="cate[]" value="{$sval.id}"/>
                </td>-->
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="__ROOT__/statics/admin/images/tv-item.gif" class="expandable" id="{$val.id}" />&nbsp;&nbsp;{$sval.name}</td>
                <td align="center" class="red"><if condition="$sval.collect_time neq 0">{$sval.collect_time|date="Y-m-d H:i:s",###}</if></td>
                <td align="center"><a href="javascript:collect({$sval.id}, '{$sval.name}');" class="blue">采集</a></td>
            </tr>
            </volist>
            </volist>
            </tbody>
        </table>
<!--        <div class="btn">
            <input type="submit" class="button" name="dosubmit" value="批量采集"/>
        </div>      -->
    </form>
    </div>
<script language="javascript">
$(function(){
/*
	function is_all_checked(input){ 
		var flag=false;
		input.each(function(){ 		
			flag=$(this).attr('checked');
			if(!flag)return false;
		});
		return flag;
	}
	$('.cb').each(function(){ 
		var cb=$(this);
		var subcb=$("."+$(this).attr('id'));
		
		cb.attr('checked',is_all_checked(subcb));			  
		
		cb.click(function(){ 
			subcb.attr('checked',$(this).attr('checked'));
		});
		
		subcb.click(function(){ 
			cb.attr('checked',is_all_checked(subcb));			  
		});
	});
*/		   	
	$('.expandable').click(function(){ 
		var subcate=".sub_"+$(this).attr('id');
		if($(subcate+":visible").size()>0){ 
			$(subcate).hide();
			$(this).attr('src',ROOT_PATH+'/statics/admin/images/tv-expandable.gif');
		}else{
			$(subcate).show();
			$(this).attr('src',ROOT_PATH+'/statics/admin/images/tv-collapsable.gif');
		}
	});
});
function collect(cate_id, cate_name) {
	window.top.art.dialog({id:'collect'}).close();
	window.top.art.dialog({title:'淘宝数据采集--'+cate_name,id:'collect',iframe:'?m=items_collect&a=taobao_collect&cate_id='+cate_id+'&cate_name='+cate_name,width:'430',height:'160'});
}
</script>
    <else/>
    
	</if>
</div>
</body>
</html>